﻿using System.Collections.Generic;
using NExt.Core.Model.Base;

namespace NExt
{
    public class Container : Container<ContainerEvents>
    {
    }

    public abstract class Container<TEvents> : BoxComponent<TEvents>
        where TEvents : ContainerEvents, new()
    {
        protected Container()
        {
            items = new List<object>();
        }

        public int? activeItem { get; set; }
        public bool? autoDestroy { get; set; }
        public object bufferResize { get; set; } //TODO: return
        public string defaultType { get; set; }
        public object defaults { get; set; }
        public bool? hideBorders { get; set; }
        public IList<object> items { get; set; }
        public string layout { get; set; }
        public string layoutConfig { get; set; }
        public bool? monitorResize { get; set; }
    }

    public class ContainerEvents : BoxComponentEvents
    {
        public IScript add { get; set; }
        public IScript afterlayout { get; set; }
        public IScript beforeadd { get; set; }
        public IScript beforeremove { get; set; }
        public IScript remove { get; set; }
    }
}
